package com.qfhd.soft.cjzcore.TaskCenter.GDT;

import android.app.Activity;
import android.content.Context;
import android.widget.FrameLayout;

import com.qfhd.soft.cjzcore.CJZConstant;
import com.qfhd.soft.cjzcore.Listener.CJAdListener;
import com.qfhd.soft.cjzcore.Listener.CJLoadFinishListener;
import com.qfhd.soft.cjzcore.Listener.CJRetListListener;
import com.qfhd.soft.cjzcore.User.CJZUser;
import com.qq.e.comm.managers.setting.GlobalSetting;

public class CJGDTsdk {

//    public static String APPID = "1110327936";
//    public static final String chapingId = "4001703369330510";//插屏
//    public static String NaviAd = "9041209329337360";//原生模板
//    public static String SplashId = "4031305349230215";//开屏
//    public static String RewardVideo = "3081100369038475";//激励视频
    public static String APPID = "";
    public static final String chapingId = "";//插屏
    public static String NaviAd = "";//原生模板
    public static String SplashId = "";//开屏
    public static String RewardVideo = "";//激励视频


    private Context mContext;

    private static CJGDTsdk GDTsdk;

    public static CJGDTsdk getInstance() {
        if (GDTsdk == null) {
            synchronized (CJGDTsdk.class) {
                GDTsdk = new CJGDTsdk();
            }
        }
        return GDTsdk;
    }

    public void init(Context context) {
        mContext = context;
//        GlobalSetting.setChannel(CJZConstant.GDT.channel_type); //9：应用宝
    }

    public void setAPPID(String appid){
        APPID = appid;
    }

    public void setSplashId(String splashId){
        SplashId = splashId;
    }

    public void setRewardVideoId(String rewardVideoId){
        RewardVideo = rewardVideoId;
    }

    public void setNaviAdId(String naviAdId){
        NaviAd = naviAdId;
    }

    public static void showSplashAd(Activity activity, FrameLayout adContainer, CJLoadFinishListener overListener) {
        CJGTD_Splash.getInstance().begin(activity,adContainer,overListener);
    }

    public static void showRewardVideo(Activity activity, Context context, CJAdListener statusListener){
        CJGDT_RewardVideo.getInstance().show(activity,context,statusListener);
    }

    public static void showNavi(Context context, int width, int height, FrameLayout mExpressContainer, Activity activity, CJAdListener statusListener){
        CJGDT_Navi.getInstance().show(context,width,height,mExpressContainer,activity,statusListener);
    }

    public static void showNavi_dialog(Context context, int width, int height, FrameLayout mExpressContainer, Activity activity, CJAdListener statusListener){
        CJGDT_Navi_Dialog.getInstance().show(context,width,height,mExpressContainer,activity,statusListener);
    }

    public static void getListNaviAd(Context context, int width, int height, CJRetListListener retListener, CJAdListener adListener){
        CJGDT_List_Navi.getInstance().getAds(context,width,height,retListener,adListener);
    }
}
